{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Transformers cheat sheets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### dunders glossary\n",
    "\n",
    "| Type | Dunder | Meaning | `sktime` class |\n",
    "| --- | --- | --- | --- |\n",
    "| compose | `*` | chaining/pipeline - also works with other estimator types | type dependent |\n",
    "| compose | `**` | chaining to secondary input of another estimator | type dependent |\n",
    "| compose | `+` | feature union | `FeatureUnion` |\n",
    "| interface | `~` | invert | `InvertTransform` |\n",
    "| structural | `¦` | multiplexing (\"switch\") | type dependent |\n",
    "| structural | `-` | optional passthrough (\"on/off\") | `OptionalPassthrough` |"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### selected useful transformers, compositors, adapters\n",
    "\n",
    "* delay fitting to `transform` via `sktime.transformations.compose.FitInTransform`\n",
    "* any `pandas` method via `sktime.transformations.compose.adapt.PandasTransformAdaptor`\n",
    "* date/time features via `sktime.transformations.series.date.DateTimeFeatures`\n",
    "* lags via `transformations.series.lag.Lag`\n",
    "* differences, first and n-th, via `transformations.series.difference.Differencer`\n",
    "* scaled logit via `transformations.series.scaledlogit.ScaledLogitTransform`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Transformer type glossary\n",
    "\n",
    "Common types of transformation in `sktime`:\n",
    "\n",
    "| from | to | base class | examples (sci) | examples (`sktime`) |\n",
    "| --- | --- | --- | --- | --- |\n",
    "| time series | scalar features | `BaseTransformer` (`Primitives` output) | `tsfresh`, or 7-number-summary | `Catch22`, `SummaryTransformer` |\n",
    "| time series | time series | `BaseTransformer` (`Series`, `instancewise`)  | detrending, smoothing, filtering, lagging | `Detrender`, `Differencer`, `Lag`, `Filter` |\n",
    "| time series panel | also a panel | `BaseTransformer` (`Series` output)  | principal component projection | `PCATransformer`, `PaddingTransformer` |\n",
    "| two feature vectors | a scalar | `BasePairwiseTransformer` | Euclidean distance, L1 distance | `ScipyDist`, `AggrDist`, `FlatDist` |\n",
    "| two time series | a scalar | `BasePairwiseTransformerPanel` | DTW distance, alignment kernel | `DtwDist`, `EditDist` |\n",
    "\n",
    "first three = \"time series transformers\", or, simply, \"transformers\"\n",
    "\n",
    "all \"transformers\" follow the same base interface.\n",
    "\n",
    "\"pairwise transformers\" have separate base interface (due to two inputs)\n",
    "\n",
    "include distances and kernels between time series or feature vectors\n",
    "\n",
    "all inherit `BaseObject` and follow unified `skbase` interface with `get_params`, `get_fitted_params`, etc"
   ]
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  },
  "vscode": {
   "interpreter": {
    "hash": "e61b44dca3bf47c8973c8cd627825697e2dad493e19dd6592afda0a0a3c312a0"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
